﻿using System;
using Honeycomb.Core;

namespace Honeycomb.Protocol.Messages
{
    /// <summary>
    /// Protocol message sent from client when the client want to submit a task execution result to
    /// the server.
    /// 
    /// Allowed to be sent after a client has authenticated with the server.
    /// </summary>
    [Serializable]
    class ResultRequest : IMessage
    {
        /// <summary>
        /// Task that was executed.
        /// </summary>
        public TaskBase Task { get; set; }

        /// <summary>
        /// Result of the execution. Null if an exception was thrown during task execution.
        /// </summary>
        public object Result { get; set; }

        /// <summary>
        /// Any exception occured during execution. Null if task was executed without exceptions.
        /// </summary>
        public Exception Exception { get; set; }
    }
}
